# encoding: utf-8


import random


target = random.randint(1, 1000)

count = 0

while True:
	try:
		guess = eval(input('请输入一个猜测的整数(1~1000)退出输入(1001):'))
	except:
		print('输入有误，请重试，不计入猜测次数哦！')
		continue
	count += 1
	
	if guess == 1001:
		break
	elif guess > target:
		print('猜大了')
	elif guess < target:
		print('猜小了')
	else:
		print('猜对了')
		print('此轮的猜测次数:', count)
		continue
		